package chat;

import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;

public class Client2 {
    public static void main(String[] args) throws InterruptedException, IOException {
        Socket socket = new Socket(InetAddress.getByName("127.0.0.1"), 9960);
        System.out.println("启动新的客户端。");

        Receive receive = new Receive(socket);
        receive.start();

        Send send = new Send(socket);
        send.start();

        send.join(); // 阻塞主线程  等发送线程结束，才结束整个程序
        socket.close();
    }
}
